Mass storage memory devices such as flash cards, USB (“universal serial bus”) sticks, or solid-state disks use flash semiconductor structures to store data in a nonvolatile memory device. A nonvolatile memory device refers to a memory device for which a power source can be switched “off” without losing the contents of the memory. Nonvolatile memory devices include flash memory devices that may semi-permanently retain an electric charge to represent one or more bits, or a “hard disk” (also referred to as a “hard drive”) that may a semi-permanently retain a magnetic charge to store one or more bits. Semiconductor devices such as SRAMs (static random access memories) and DRAMs (dynamic random access memories) are referred to as volatile memory devices because they lose the contents of their memories if a bias voltage source is switched off.
Today's magnetic-based mass storage devices such as floppy disks or hard disks are organized in so-called sectors (a sector of being a portion of a “track” in the disk), each sector typically storing 512 bytes (in magnetic disks), and each sector identified with an individual logical block address (LBA). An LBA is a logical addressing scheme wherein a fixed one-to-one relationship is established between a sector of data and the physical location on the disk in which the respective sector of data is stored. The operating system of a computer collectively handles the LBAs of the mass storage device and builds a file system based thereon. The computer operating system reads and writes sequential amounts of LBAs with different block sizes from and to the mass storage device. In a hard disk, data can be freely written, read, or rewritten one or more sectors at a time.
Unlike magnetic memory devices, in flash memory devices there are restrictions regarding reading and writing of data. Flash memory devices are organized in pages, typically of size 4 kB (kilobytes) plus data protection headroom, and in erase blocks (also referred to herein as a “block”), for example, an erase block of size 64 pages. Accordingly, a 4 kB page of flash memory can store eight 512-byte sectors. A page of flash memory that is not programmed, i.e., a page that does not already contain data, can be written only as an entire page. Similarly, data can be read one page at a time. Flash memory has a further restriction in that it can be erased only a block at a time. Thus, to rewrite selected data in a portion of memory, an entire block must be read, erased, the new data merged with the previous data, and the merged data rewritten as a block, i.e., a copy and merge operation must be performed. Data can thus not be overwritten except as an entire block.
Writing and rewriting is generally referred to as programming. In a typical (NAND structured) flash memory, a page is written to all 1's to erase previously stored data, and can then be rewritten with the intended data. A block of data in a flash memory device is typically written to a different physical portion of the flash memory device to alleviate a wear-out problem associated with repetitively storing data in the same memory location. A translation (mapping) table stored in nonvolatile memory of the flash memory device is thus required in the communication link with a host computer to logically associate a sector of data with its physical location. A translation table is also generally moved each time it is rewritten. The restrictions of reading, writing, and rewriting in a flash memory device are also applicable to the translation table stored therein.
To execute a copy and merge operation, non-programmed blocks of memory must be available. Therefore, after several copy and merge operations, there are erase operations that are necessary to maintain availability of empty blocks for further erase operations.
In the ordinary operation of a flash memory device, i.e., a solid-state disk (“SSD”), coupled to a host computer, there are typically small amounts of new data that are required to be copied and merged with old data stored in an erase block. The merged data is stored in a new flash memory location. This results in a substantial amount of data that must be copied and merged for a small amount of new data to be stored due to do need to copy and merge all the unchanged data originally stored in the erase block.
A conventional way of handling free blocks of memory in a USB flash memory stick is the use of so-called log blocks. A log block provides a temporary area of memory (i.e., a previously erased erase block) to consecutively accumulate merged data, with appropriate updates to the mapping table. After valid data in an erase block are merged to a log block, the previous erase block location is identified as invalid and can be erased, making it available for another erase-block merging operation. This procedure is continued until all sectors of the log block are filled. When a log block is full, a new log block can be started. A garbage collection process refers to erasing erase blocks that contain invalid data to free the erase block up for reuse.
The disadvantage of this procedure is that a huge amount of data is typically copied before a single (invalid) block can be erased. For an USB memory stick where normally large amounts of consecutive sectors are written, this procedure provides reasonably satisfactory performance, since sectors are stored consecutively in the log block. But for an SSD with frequent random writes of small amounts of data, this procedure results in substantial inefficiency for erase operations.
Due to limitations of writing new data to flash memory devices using conventional procedures as described above wherein a large amount of data must be copied and merged for each write access before a single block can be erased, a more efficient solution for managing storage of new data in such devices is required. Thus, there is a need for a process and related method for an efficient erase operation that is necessary to be performed for storage of new data in the nonvolatile memory of a flash memory device that avoids the inefficiencies of conventional processes.